<%@ page isELIgnored="false" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<script type="text/javascript">
	jQuery(function($){
		//下拉表格初始化
		$('#addDeptId').combobox({
			valueField:'id', //值字段
		    textField:'name', //显示的字段
		    url:'dept/allList',
		    panelHeight:'auto',
		    required:true,
			editable:false//不可编辑，只能选择
		});
		returnJson();
	});
	function returnJson(){
    	var json = '${ code.aab}';
    	json=eval(json);
    	return json;
    }
	function addOrUpdateUser(){
		var r = $('#aaaForm').form('validate');
		if(!r) {
			return false;
		}
	    if($('#id').val()!='')
	    {

			$.post("aab/aabUpdate",$("#aabForm").serializeArray(),function(data){
				$('#MyPopWindow').window('close');
				$('#aabTable').datagrid('reload');  
				$.messager.alert('提示',data.mes,'info');
			});
	    }else
	    {
			$.post("aab/aabAdd",$("#aabForm").serializeArray(),function(data){
				$('#MyPopWindow').window('close');
				$('#aabTable').datagrid('reload');  
				$.messager.alert('提示',data.mes,'info');
			});
	    }
	}
</script>
<!-- 验证还是jquery-validation好用，这里省事没用 -->
<form id="aabForm" method="post" style="margin: 10;text-align: center;">
	<input type="hidden" name="version" value="${aab.version}">
	<input type="hidden" name="id"  id="id" value="${aab.id}">
	<input type="hidden" name="delflg" value="${aab.delflg}">
	<input type="hidden" name="creatuserid" value="${aab.creatuserid }">
	<table>
		<tr>
			<td>登记日期：</td>
			<td><input name="creatdate" value='<fmt:formatDate value="${aab.creatdate }" pattern="yyyy-MM-dd"/>' readonly="true" style="width: 200"
				 class="easyui-datebox" required="true">
			</td>
		</tr>
		<tr>
			<td>商户名称(全)：</td>
			<td><input name="nameall" value="${aab.nameall }" style="width: 200"
				class="easyui-validatebox" validType="length[3,40]" required="true"></td>
		</tr>
		<tr>
			<td>商户名称(简)：</td>
			<td><input name="namesimp" value="${aab.namesimp }" style="width: 200"
				validType="length[2,20]" class="easyui-validatebox" required="true">
			</td>
		</tr>
		<tr>
			<td>手续费支付模式：</td>
			<td>
				<input name="selltaxtype" value="${aab.selltaxtype }" required="true" class="easyui-combobox" style="width: 200;" editable="false" data-options="valueField: 'label',textField: 'value',
		data: returnJson()" />
			</td>
		</tr>
		<tr>
			<td>手续费率：</td>
			<td><input name="selltax" value="${aab.selltax }" style="width: 200"
				class="easyui-numberbox" min="1" max="100" required="true"></td>
		</tr>
		<tr>
			<td>负责人姓名：</td>
			<td><input type="text" name="owner" value="${aab.owner }" style="width: 200"></td>
		</tr>
		<tr>
			<td>负责人Email：</td>
			<td><input type="text" name="email" value="${aab.email }" class="easyui-validatebox" data-options="validType:'email'" style="width: 200"></td>
		</tr>
		<tr>
			<td>负责人移动电话：</td>
			<td><input type="text" name="telephone" value="${aab.telephone }" style="width: 200"></td>
		</tr>
		<tr>
			<td>负责人固定电话：</td>
			<td><input type="text" name="phone" value="${aab.phone }" style="width: 200"></td>
		</tr>
		<tr>
			<td>商户住址：</td>
			<td><input id="address" name="address" value="${aab.address }" style="width: 200"></td>
		</tr>
	</table>
	<a href="#" id="btn-back" onclick="closeWindow();" class="easyui-linkbutton" iconCls="icon-back">返回</a>
	<a href="#" id="btn-add" onclick="addOrUpdateUser();" class="easyui-linkbutton" iconCls="icon-save">保存</a>
</form>